import React, { Component } from 'react'

// 引入子组件
import Son from './Son'
export default class Father extends Component {
    state = {
        num: 100,
        nameArr: ['乔国强', '张纯', '李云飞']
    }
    render() {
        return (
            <div>
                <p>我是父组件</p>
                {/* 使用子组件 */}
                {/* <Son>{this.state.num}</Son> */}
                {/* <Son>{this.state.nameArr}</Son> */}
                <Son>
                    <ul>
                        {
                            this.state.nameArr.map((item, index) => <li key={index}>{item}</li>)
                        }
                    </ul>
                </Son>
            </div>
        )
    }
}
